﻿@using System.Web.UI.WebControls
@model GioHangViet.Models.Promotion
@{
    ViewBag.Title = "Create";
}
<h2>
    Create</h2>
<script src="@Url.Content("~/Scripts/jquery-1.5.1.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Content/js/Promotion.js")" type="text/javascript"></script>
@using (Html.BeginForm())
{
    @Html.ValidationSummary(true)
    <fieldset>
        <legend>Promotion</legend>
        @Html.HiddenFor(model => model.Alias)
        @Html.HiddenFor(model => model.CreateDate)
        @Html.HiddenFor(model => model.CreateBy)

        <div class="control-group">
            <div class="control-label">
                Category: 
            </div>
            <div class="controls">
                @Html.DropDownList("Categories", (SelectList)ViewBag.Category, "=== Select category ===", new { onchange = "GetDistrict(this)", id = "categoryDropdownList" })
            </div>
        </div>

        <div class="control-group">
            <div class="control-label">
                Products:
            </div>
            <div class="controls">
                @Html.DropDownList("District", new SelectList(new ListItemCollection { "=== Select products ===" }), new { id = "productDropdownList" })
            </div>
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Title)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Title)
            @Html.ValidationMessageFor(model => model.Title)
        </div>
        <div class="editor-label">
            @Html.LabelFor(model => model.Description)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Description)
            @Html.ValidationMessageFor(model => model.Description)
        </div>
        <div class="editor-label">
            @Html.LabelFor(model => model.PromotionPercent)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.PromotionPercent)
            @Html.ValidationMessageFor(model => model.PromotionPercent)
        </div>
        <div class="editor-label">
            @Html.LabelFor(model => model.StartDate)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.StartDate)
            @Html.ValidationMessageFor(model => model.StartDate)
        </div>
        <div class="editor-label">
            @Html.LabelFor(model => model.EndDate)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.EndDate)
            @Html.ValidationMessageFor(model => model.EndDate)
        </div>
        <p>
            <input type="submit" value="Create" />
        </p>
    </fieldset>
}
<div>
    @Html.ActionLink("Back to List", "Index")
</div>
